﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Iterator_Pattern
{
    class SongsOfThe90s : SongIterator
    {
        public Dictionary<int, SongInfo> bestSongs;
        int hashKey = 0;

        public SongsOfThe90s()
        {
            bestSongs = new Dictionary<int, SongInfo>();
            addSong("Losing My Religion", "REM", 1991);
            addSong("Creep", "Radiohead", 1993);
            addSong("Walk on the Ocean", "Toad the wet Sprocket", 1991);
        }

        public void addSong(String songName, String bandName, int yearReleased)
        {
            SongInfo songInfo = new SongInfo(songName, bandName, yearReleased);
            bestSongs.Add(hashKey, songInfo);
            hashKey++;
        }

        public IEnumerator createIterator()
        {
            return bestSongs.Values.GetEnumerator();
        }
    }
}
